Sure, although I doubt that will help you much; main is a mess, I haven't cleaned it up yet, and ClassRange has been used in a couple of programs before without any problems
Code:
//ClassRange.h
#ifndef CLASS_RANGE_H
#define CLASS_RANGE_H
using namespace std;
template <typename T>
class ClRange{
private:
T m_tLoBound;
T m_tHiBound;
public:
ClRange(T tLoBound, T tHiBound)
:m_tLoBound(tLoBound), m_tHiBound(tHiBound)
{}
ClRange()
:m_tLoBound(0), m_tHiBound(0)
{}
~ClRange() {}
T getLower() { return m_tLoBound; }
T getUpper() { return m_tHiBound; }
void setLower(T tValue) { m_tLoBound = tValue; }
void setUpper(T tValue) { m_tHiBound = tValue; }
void set(T tLower, T tUpper) { m_tLoBound = tLower; m_tHiBound = tUpper; }
};
#endif
Code:
//main.cpp
#include <cstdlib>
#include <ctime>
#include "ClassUniverse.h"
#include "ClassValues.h"
using namespace std;
int main()
{
allegro_init();
install_timer();
install_keyboard();
set_color_depth(32);
if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, ClValues::nScreenHight, ClValues::nScreenWidth, 0, 0) < 0) {
allegro_message("Couldn't set gfx mode: %s\n", allegro_error);
exit(1);
}
ClValues::dblbuffer = create_bitmap(ClValues::nScreenHight, ClValues::nScreenWidth);
clear(ClValues::dblbuffer);
srand(time(NULL));
ClUniverse TheUniverse;
while(!key[KEY_ESC]) {
TheUniverse.calculateDisplacement();
TheUniverse.drawObjects();
}
return 0;
}
END_OF_MAIN();
Hope it helps.